package com.cyt.web.controller.sys;

import com.cyt.base.enums.BusinessType;
import com.cyt.base.enums.OperatorType;
import com.cyt.base.model.dto.ReturnResult;
import com.cyt.sys.aspect.BaseLog;
import com.cyt.sys.model.vo.SysUserVo;
import com.cyt.sys.service.SysOrgUserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * 用户和组织控制层
 *
 * @author shengQiang yu
 * @date 2019-04-24 16:10
 */
@RestController
public class SysOrgUserController extends SysBaseController {

    @Resource
    private SysOrgUserService sysOrgUserService;


    /**
     * 选择器查询
     *
     * @param id      对象id（这里指组织机构id)
     * @param keyWord 关键字
     * @return ReturnResult 对象
     * @author liufu zhu
     * @date 2018-11-29 15:43
     */
    @BaseLog(module = "系统模块", classz = "用户和组织管理", methods = "选择器查询", businessType = BusinessType.GET, operatorType = OperatorType.MANAGE)
    @RequestMapping(value = "/sysOrgUser/selector", method = RequestMethod.POST)
    public ReturnResult selector(String id, String keyWord) {
        SysUserVo sysUserVo = new SysUserVo();
        sysUserVo.setOrgId(id);
        sysUserVo.setName(keyWord);
        ReturnResult returnResult = sysOrgUserService.selector(sysUserVo);
        return returnResult;
    }

}
